package com.demo.controller;


import com.demo.controller.from.MovieAddMoneyFrom;
import com.demo.controller.from.MovieScoreListFrom;
import com.demo.exetion.MainExection;
import com.demo.service.MovieScoreService;
import com.demo.utils.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 杨森
 * @since 2022-04-13
 */
@RestController
@RequestMapping("/movieScore")
@Api(value = "评分",tags = "评分")
public class MovieScoreController {

    @Resource
    private MovieScoreService movieScoreService;
    @PostMapping("/addScore")
    @ApiOperation(value = "新增评分",notes = "新增评分")
    @ApiImplicitParam(value = "鉴权token",name = "authentication_token",paramType  = "header", dataType = "String", required=true)
    public Result<Boolean> addScore(@RequestBody MovieScoreListFrom movieScoreListFrom) throws MainExection {
        Boolean aBoolean = movieScoreService.addScore(movieScoreListFrom);
        return Result.getInstance(Boolean.class).setData(aBoolean);
    }

}

